<?php
/**
 * Created by PhpStorm.
 * User: ciwei
 * Date: 2017/12/4
 * Time: 19:45
 */
namespace app\index\model;

use \think\Model;

class Msg extends Model
{
    public function getMsg()
    {
        $data = db('msg')
            ->alias('m')
            ->join('question q','m.qid = q.qid')
            ->join('user u','m.suid = u.uid')
            ->join('cate c','q.cid = c.cid')
            ->field('u.nickname,u.uid,c.name,c.cid,q.title,m.*')
            ->where('m.duid',session('uid'))
            ->order('m.ctime desc')
            ->select();
        return $data;
    }
}